package cn.jofei.common;

import cn.jofei.common.enums.Types;
import lombok.Data;

import java.util.Objects;

/**
 * @author bao
 * @version ngbao v
 * @description 客户端注册信息
 * @date 2022/3/1 17:07
 */
@Data
public class ProxyInfo {
    /**
     * 子域名
     */
    private String subdomain;
    /**
     * 本地可访问的ip
     */
    private String localIP;
    /**
     * 本地访问的端口
     */
    private Integer localPort;
    /**
     * 远程的端口 tcp
     */
    private Integer remotePort;
    /**
     * 连接类型
     */
    private Types type;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProxyInfo proxyInfo = (ProxyInfo) o;
        return Objects.equals(subdomain, proxyInfo.subdomain) && Objects.equals(remotePort, proxyInfo.remotePort);
    }

    @Override
    public int hashCode() {
        return Objects.hash(subdomain, remotePort);
    }
}
